from selenium import webdriver
from gqingzy.zye3.Base import Base
import pytest,time,openpyxl
@pytest.fixture()
def dr():
    dr=webdriver.Edge()
    yield dr
    time.sleep(2)
    dr.quit()
def test_001(dr):
    wo = openpyxl.load_workbook('min.xlsx')
    exe = wo['Sheet1']
    ba = Base(dr)
    for i in exe.iter_rows(min_row=2, values_only=True):
        ac = i[2]
        p = {}
        time.sleep(2)

        if ac == 'get_url':
            p['url'] = i[5]
        elif ac in ['send_keys', 'click']:
            p['loc'] = [i[3], i[4]]
            if ac == 'send_keys':
                p['info'] = i[5]
        elif ac == 'sleep':
            p['s'] = i[5]

        method = getattr(ba, str(ac))
        method(**p)